<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // const prototype1 = [];
      // const object1 = Object.create(prototype1);
      // console.log(object1);

      const fn = (l, r) => {
        let proto = Object.getPrototypeOf(l);
        let rp = r.prototype;
        while (1) {
          if (!proto) return false;
          if (proto === rp) return true;
          proto = Object.getPrototypeOf(proto);
        }
      };

      console.log(fn([1], Array));
    </script>
  </body>
</html>
